import request from "./request";

export const creatCategory = (value: any) => {
  return request({
    method: "post",
    url: "rest/category",
    data: value,
  });
};

//获取分页列表数据
export const getCreatCategory = () => {
  return request({
    method: "get",
    url: "rest/category",
  });
};


//获取被编辑数据的详情
export const getEditMsg = (id:string[] | string) => {
  return request({
    method:'get',
    url:`rest/category/${id}`
  })
}

//更新数据
export const upDateCategory = (id:string | string[],data:any) => {
return request({
  method:'put',
  url:`rest/category/${id}`,
  data:data,
})
}

//删除分类
export const deletCategory = (id:string | string[]) => {
return request({
  method:'delete',
  url:`rest/category/${id}`
})
}

